<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Electronet</title>


  </head>

  <body>
     
	            <a href="#" class="dropdown-toggle" data-toggle="dropdown">LISTAR PUBLICACIONES <b class="caret"></b></a>

		
		<form id="form1" name="form1" method="post" action="ListarVentasServlet" class="form-horizontal" role="form">
		  <p> 
		    <label>
		    <input type="submit" name="button" id="button" value="Mis ventas" />
		    </label>

		  </p>

		</form>
		<div class="table-responsive">
		<table width="550" height="65" border="1" cellpadding="0" cellspacing="0" class="table table-hover">

		  <tr>
		    <th width="49" scope="col">ITEM</th>
		    <th width="192" scope="col">PRODUCTO</th>
		    <th width="107" scope="col">DESCRIPCION</th>
		    <th width="192" scope="col">PRECIO</th>
		    <th width="192" scope="col">STOCK</th>
		  </tr>
		<%@page import="java.util.*, electronet.modelo.Publicacion" %>
		<%
		Collection<Publicacion> arreglo = (ArrayList<Publicacion>)request.getAttribute("ventas");
		if(arreglo != null) { 
		int i = 1;
		for(Publicacion x : arreglo) {
		%>  
		  <tr>
		    <td><%=i++ %></td>
		    <td><% out.print(x.getTitulo()); %></td>
		    <td><% out.print(x.getDescripcion()); %></td>
		    <td><% out.print(x.getPrecio()); %></td>
		    <td><% out.print(x.getStock()); %></td>
	
	</tr>

	<% }
		  } %>
		  <form id="form1" name="form1" method="post" action="ListarComprasServlet" class="form-horizontal" role="form">
<!-- 		  <p>  -->
<!-- 		    <label> -->
<!-- 		    <input type="submit" name="button" id="button" value="Mis ventas" /> -->
<!-- 		    </label> -->

<!-- 		  </p> -->
		  <p> 
		    <label>
		    <input type="submit" name="button" id="button" value="Mis compras" />
		    </label>

		  </p>
		</form>
		<div class="table-responsive">
		<table width="550" height="65" border="1" cellpadding="0" cellspacing="0" class="table table-hover">
		  <tr>
		    <th width="49" scope="col">ITEM</th>
		    <th width="192" scope="col">PRODUCTO</th>
		    <th width="107" scope="col">DESCRIPCION</th>
		    <th width="192" scope="col">PRECIO</th>
		    <th width="192" scope="col">STOCK</th>
		  </tr>
		  <%@page import="java.util.*, electronet.modelo.CompraCabecera" %>
		  <%
		Collection<CompraCabecera> compras = (ArrayList<CompraCabecera>)request.getAttribute("compras");
		if(compras != null) { 
		int i = 1;
		for(CompraCabecera x : compras) {
		%>  
		  <tr>
		    <td><%=i++ %></td>
		    <td><% out.print(x.getIdcompra()); %></td>
		    <td><% out.print(x.getIdcomprador()); %></td>
		    <td><% out.print(x.getFechacompra()); %></td>
		    <td><% out.print(x.getTotal()); %></td>
   
	
	</tr>

	<% }
		  } %>
		  
		</table>
		</div>


    
  </body>
</html>
